{% extends 'base.html' %}

{% block title %}视频数据分析词云{% endblock %}

{% block head %}
    <title>Comments Gender Distribution</title>
{% endblock %}

{% block body %}
    <div class="container">
        {#        <div id="line" style="width:600px; height:400px;"></div>#}
        <div id="wordcloud"  style="width:1000px; height:600px;"></div>
    </div>
{% endblock %}

{% block js %}
    <script>
        var chart = echarts.init(document.getElementById('wordcloud'), 'white', {renderer: 'canvas'});

        $(function () {
                fetchData(chart);
                setInterval(fetchData, 1000 * 60 * 60);
            }
        )

        function fetchData() {
            $.ajax({
                type: "GET",
                url: "http://127.0.0.1:5000/analysis/get_wordcloud_chart/{{ bvid }}",
                dataType: 'json',
                success: function (result) {
                    chart.setOption(result);
                }
            });
        }
    </script>
{% endblock %}
